
package vo;

import entities.Submission;
import java.util.Date;

/**
 *
 * @author sbaldrich
 */
public class VOSubmission {

    private Integer idSubmission;
    private String code;
    private Date date;
    private String language;
    private String verdict;
    private String problemCode;
    private String contestCode;
    private String userHandle;

    
    
    public VOSubmission() {
    }

    public VOSubmission(Submission s)
    {
        this.setCode(s.getCode());
        this.setContestCode(s.getContest().getContestCode());
        this.setDate(s.getDate());
        this.setIdSubmission(s.getIdSubmission());
        this.setLanguage(s.getLanguage());
        this.setProblemCode(s.getProblem().getProblemCode());
        this.setUserHandle(s.getUser().getHandle());
        this.setVerdict(s.getVerdict());

    }


    public String getCode()
    {
        return code;
    }

    public void setCode(String code)
    {
        this.code = code;
    }

    public String getContestCode()
    {
        return contestCode;
    }

    public void setContestCode(String contestCode)
    {
        this.contestCode = contestCode;
    }

    public Date getDate()
    {
        return date;
    }

    public void setDate(Date date)
    {
        this.date = date;
    }

    public Integer getIdSubmission()
    {
        return idSubmission;
    }

    public void setIdSubmission(Integer idSubmission)
    {
        this.idSubmission = idSubmission;
    }

    public String getLanguage()
    {
        return language;
    }

    public void setLanguage(String language)
    {
        this.language = language;
    }

    public String getProblemCode()
    {
        return problemCode;
    }

    public void setProblemCode(String problemCode)
    {
        this.problemCode = problemCode;
    }

    public String getUserHandle()
    {
        return userHandle;
    }

    public void setUserHandle(String userHandle)
    {
        this.userHandle = userHandle;
    }

    public String getVerdict()
    {
        return verdict;
    }

    public void setVerdict(String verdict)
    {
        this.verdict = verdict;
    }

    @Override
    public String toString()
    {
        return (getDate()+":"+getUserHandle()+" , "+getContestCode() +
                " , "+ getProblemCode() + " ->" + getVerdict());
    }

}
